#include<bits/stdc++.h>
using namespace std;
const int N = 3e4+20;

typedef pair<long double,long double> com;
com operator*(com va,com vb){
	return {va.first*vb.first - va.second*vb.second,va.first*vb.second + va.second*vb.first};
}
com operator+(com va,com vb){
	return {va.first + vb.first,va.second + vb.second};
}
com operator-(com va,com vb){
	return {va.first - vb.first,va.second - vb.second};
}
vector<int> trs[18];
void init(){
	for(int lgt = 0;lgt <= 17;lgt++){
		int tot = 1<<lgt;
		trs[lgt] = vector<int>(tot);
		for(int j = 1;j < tot;j++){
			trs[lgt][j] = (trs[lgt][j >> 1]>>1) | ((j & 1)<<(lgt - 1));
		}
	}
}
const long double PI = acosl(-1.0);
vector<com> FFT(vector<com> val,int tot,int lgt){
	vector<com> res(tot);
	for(int i = 0; i< tot;i++){
		if(trs[lgt][i] < val.size()){
			res[i] = val[trs[lgt][i]];
		}
	}
	for(int i = 1;i <= lgt;i++){
		int len = 1<<i;
		int hlen = len>>1;
		com one  = make_pair(cosl(PI/hlen),sinl(PI/hlen));
		for(int j = 0;j < tot;j += len){
			com base = make_pair(1,0);
			for(int k = 0;k < hlen;k++,base = base*one){
				com va = res[j + k],vb = res[j + k + hlen]*base;
				res[j + k] = va + vb;
				res[j + k + hlen] = va - vb;
			}
		}
	}
	return res;
}
vector<com> IFFT(vector<com> val,int tot,int lgt){
	vector<com> res(tot);
	for(int i = 0; i< tot;i++){
		if(trs[lgt][i] < val.size()){
			res[i] = val[trs[lgt][i]];
		}
	}
	for(int i = 1;i <= lgt;i++){
		int len = 1<<i;
		int hlen = len>>1;
		com one  = make_pair(cos(PI/hlen),-sin(PI/hlen));
		for(int j = 0;j < tot;j += len){
			com base = make_pair(1,0);
			for(int k = 0;k < hlen;k++,base = base*one){
				com va = res[j + k],vb = res[j + k + hlen]*base;
				res[j + k] = va + vb;
				res[j + k + hlen] = va - vb;
			}
		}
	}
	return res;
}
vector<long long> operator*(const vector<long long> &va,const vector<long long> &vb){
	vector<com> v1(va.size()),v2(vb.size());
	for(int i = 0;i < va.size();i++){
		v1[i].first = va[i];
	}
	for(int i = 0;i < vb.size();i++){
		v2[i].first = vb[i];
	}
	int len = va.size() + vb.size() - 1;
	int lgt = 32 - __builtin_clz(len),tot = 1<<lgt;
	v1 = FFT(v1,tot,lgt),v2 = FFT(v2,tot,lgt);
	for(int i = 0;i < tot;i++){
		v1[i] = v1[i]*v2[i];
	}
	v1 = IFFT(v1,tot,lgt);
	v1.resize(len);
	vector<long long> vl(len);
	for(int i = 0;i < v1.size();i++){
		vl[i] = round(v1[i].first/tot);
	}
	return vl;
}
vector<long long> operator+(const vector<long long> &va,const vector<long long> &vb){
	vector<long long > res(va);
	if(vb.size() > res.size()){
		res.resize(vb.size());
	}
	for(int i = 0;i < vb.size();i++){
		res[i] = res[i] + vb[i];
	}
	return res;
}
vector<int> bian[N];
bool vis[N];
int siz[N];
int ms[N];
int search_center(int x,int fa,int tot){
	int res = 0;
	ms[x] = 0;
	for(int v: bian[x]){
		if(vis[v] || v == fa){
			continue;
		}
		int bs = search_center(v,x,tot);
		ms[x] = max(ms[x],siz[v]);
		if(ms[bs] < ms[res]){
			res = bs;
		}
	}
	ms[x] = max(ms[x],tot - siz[x]);
	if(ms[x] < ms[res]){
		res = x;
	}
	return res;
}
void presiz(int x,int fa){
	siz[x] = 1;
	for(int v: bian[x]){
		if(v == fa || vis[v]){
			continue;
		}
		presiz(v,x);
		siz[x] += siz[v]; 
	}
}
vector<long long> rs; 
void push(int x,int fa,int dep,vector<long long> &val){
	if(dep >= val.size()){
		val.resize(dep + 1);
	}
	val[dep]++;
	for(int v: bian[x]){
		if(v == fa || vis[v]){
			continue;
		}
		push(v,x,dep + 1,val);
	}
}
struct cmp{
	bool operator()(const vector<long long> &va,const vector<long long> &vb) const{
		return va.size() > vb.size();
	}
};
void F(int x){
	presiz(x,0);
	if(siz[x] == 1)return;
	int rot = search_center(x,0,siz[x]);
	vector<vector<long long>> pl;
	for(int v : bian[rot]){
		if(vis[v]){	
			continue;
		}
		vector<long long> sz(1,0);
		push(v,rot,1,sz);
		for(int i = 1;i < sz.size();i++){
			rs[i] += sz[i];
		}
		pl.push_back(sz);
	}	
	sort(pl.begin(),pl.end(),cmp());
	for(int i = 1;i < pl.size();i++){
		vector<long long> res = pl[i]*pl[i-1];
		for(int i = 0;i < res.size();i++){
			rs[i] = rs[i] + res[i];
		}
		pl[i] = pl[i - 1] + pl[i];
	}
	//cerr<<rs[5]<<' '<<x<<'\n';
	vis[rot] = 1;
	for(int v : bian[rot])
	{
		if(vis[v]){
			continue;
		}
		F(v);
	}
}
int main(){
	init();
	int n;
	cin>>n;
	for(int i = 2;i <= n;i++){
		int u,v;
		cin>>u>>v;
		u++;
		v++;
		bian[u].push_back(v);
		bian[v].push_back(u);
	}
	ms[0] = 0x3f3f3f3f;
	rs = vector<long long>(n);
	F(1);
	rs[0] = n;
	long double ans = n;
	for(int i = 1;i < rs.size();i++){
		ans = ans + 1.0/(i + 1)*rs[i]*2;
	}
	cout<<fixed<<setprecision(4)<<ans<<'\n';
}